 package server;


import client.*;
import client.inventory.*;
import client.skills.SkillEntry;
import configs.ServerConfig;
import constants.GameConstants;
import constants.ItemConstants;
import constants.JobConstants;
import constants.ServerConstants;
import handling.world.WorldBroadcastService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import server.cashshop.CashItemFactory;
import server.cashshop.CashItemInfo;
import server.maps.MapleMapObject;
import server.quest.MapleQuest;
import tools.DateUtil;
import tools.MaplePacketCreator;
import tools.Randomizer;
import tools.packet.AndroidPacket;
import tools.packet.InventoryPacket;
import tools.packet.MTSCSPacket;

import java.awt.*;
import java.util.*;
import java.util.List;




























 public class MapleInventoryManipulator {
/*   31 */   private static final Logger log = LogManager.getLogger("ItemLog");

   public static void addRing(MapleCharacter chr, int itemId, int ringId, int sn) {
/*   34 */     CashItemInfo csi = CashItemFactory.getInstance().getItem(sn);
/*   35 */     if (csi == null) {
       return;
     }
/*   38 */     Item ring = chr.getCashInventory().toItem(csi, ringId);
/*   39 */     if (ring == null || ring.getUniqueId() != ringId || ring.getUniqueId() <= 0 || ring.getItemId() != itemId) {
       return;
     }
/*   42 */     chr.getCashInventory().addToInventory(ring);
/*   43 */     chr.send(MTSCSPacket.INSTANCE.购买商城道具(ring, sn, chr.getClient().getAccID()));
   }

   public static boolean addbyItem(MapleClient c, Item item) {
/*   47 */     return (addbyItem(c, item, false) >= 0);
   }

   public static short addbyItem(MapleClient c, Item item, boolean fromcs) {
/*   51 */     MapleInventoryType type = ItemConstants.getInventoryType(item.getItemId());
/*   52 */     short newSlot = c.getPlayer().getInventory(type).addItem(item);
/*   53 */     if (newSlot == -1) {
/*   54 */       if (!fromcs) {
/*   55 */         c.announce(InventoryPacket.getInventoryFull());
/*   56 */         c.announce(InventoryPacket.getShowInventoryFull());
       }
/*   58 */       return newSlot;
     }
/*   60 */     if (ItemConstants.isHarvesting(item.getItemId())) {
/*   61 */       c.getPlayer().getStat().handleProfessionTool(c.getPlayer());
     }
/*   63 */     if (item.hasSetOnlyId()) {
/*   64 */       item.setEquipOnlyId(MapleEquipOnlyId.getInstance().getNextEquipOnlyId());
     }
/*   66 */     c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, item))));
/*   67 */     c.getPlayer().havePartyQuest(item.getItemId());
/*   68 */     if (!fromcs && type.equals(MapleInventoryType.EQUIP)) {
/*   69 */       c.getPlayer().checkCopyItems();
     }
/*   71 */     return newSlot;
   }

   public static int getUniqueId(int itemId, MaplePet pet) {
/*   75 */     int uniqueid = -1;
/*   76 */     if (ItemConstants.isPet(itemId)) {
/*   77 */       if (pet != null) {
/*   78 */         uniqueid = pet.getUniqueId();
       } else {
/*   80 */         uniqueid = MapleInventoryIdentifier.getInstance();
       }
/*   82 */     } else if (ItemConstants.getInventoryType(itemId) == MapleInventoryType.CASH || MapleItemInformationProvider.getInstance().isCash(itemId)) {
/*   83 */       uniqueid = MapleInventoryIdentifier.getInstance();
     }
/*   85 */     return uniqueid;
   }

   public static boolean addById(MapleClient c, int itemId, short quantity, String gmLog) {
/*   89 */     return addById(c, itemId, quantity, null, null, 0L, 0, gmLog);
   }

   public static boolean addById(MapleClient c, int itemId, short quantity, int state, String gmLog) {
/*   93 */     return addById(c, itemId, quantity, null, null, 0L, state, gmLog);
   }

   public static boolean addById(MapleClient c, int itemId, short quantity, long period, String gmLog) {
/*   97 */     return addById(c, itemId, quantity, null, null, period, 0, gmLog);
   }

   public static boolean addById(MapleClient c, int itemId, short quantity, long period, int state, String gmLog) {
/*  101 */     return addById(c, itemId, quantity, null, null, period, state, gmLog);
   }

   public static boolean addById(MapleClient c, int itemId, short quantity, String owner, String gmLog) {
/*  105 */     return addById(c, itemId, quantity, owner, null, 0L, 0, gmLog);
   }

   public static byte addId(MapleClient c, int itemId, short quantity, String owner, String gmLog) {
/*  109 */     return addId(c, itemId, quantity, owner, null, 0L, 0, gmLog);
   }

   public static boolean addById(MapleClient c, int itemId, short quantity, String owner, MaplePet pet, String gmLog) {
/*  113 */     return addById(c, itemId, quantity, owner, pet, 0L, 0, gmLog);
   }

   public static boolean addById(MapleClient c, int itemId, short quantity, String owner, MaplePet pet, long period, String gmLog) {
/*  117 */     return addById(c, itemId, quantity, owner, pet, period, 0, gmLog);
   }

   public static boolean addById(MapleClient c, int itemId, short quantity, String owner, MaplePet pet, long period, int state, String gmLog) {
/*  121 */     return (addId(c, itemId, quantity, owner, pet, period, state, gmLog) >= 0);
   }

   public static byte addId(MapleClient c, int itemId, short quantity, String owner, MaplePet pet, long period, int state, String gmLog) {
/*  125 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/*  126 */     if ((ii.isPickupRestricted(itemId) && c.getPlayer().haveItem(itemId, 1, true, false)) || !ii.itemExists(itemId)) {
/*  127 */       c.announce(InventoryPacket.getInventoryFull());
/*  128 */       c.announce(InventoryPacket.showItemUnavailable());
/*  129 */       return -1;
     }
/*  131 */     MapleInventoryType type = ItemConstants.getInventoryType(itemId);
/*  132 */     int uniqueid = getUniqueId(itemId, pet);
/*  133 */     short newSlot = -1;
/*  134 */     if (!type.equals(MapleInventoryType.EQUIP)) {
/*  135 */       short slotMax = ii.getSlotMax(itemId);
/*  136 */       List<Item> existing = c.getPlayer().getInventory(type).listById(itemId);
/*  137 */       if (!ItemConstants.isRechargable(itemId)) {
/*  138 */         if (existing.size() > 0) {
/*  139 */           Iterator<Item> i = existing.iterator();
/*  140 */           while (quantity > 0 && 
/*  141 */             i.hasNext()) {
/*  142 */             Item eItem = i.next();
/*  143 */             short oldQ = eItem.getQuantity();
/*  144 */             if (oldQ < slotMax && (eItem.getOwner().equals(owner) || owner == null) && eItem.getExpiration() == -1L) {
/*  145 */               short newQ = (short)Math.min(oldQ + quantity, slotMax);
/*  146 */               quantity = (short)(quantity - newQ - oldQ);
/*  147 */               eItem.setQuantity(newQ);
/*  148 */               c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(1, eItem))));
/*  149 */               newSlot = eItem.getPosition();
             }
           }
         }





/*  158 */         while (quantity > 0) {
/*  159 */           short newQ = (short)Math.min(quantity, slotMax);
/*  160 */           if (newQ != 0) {
/*  161 */             quantity = (short)(quantity - newQ);
/*  162 */             Item nItem = new Item(itemId, (short)0, newQ, (short)0, uniqueid, (short)0);
/*  163 */             newSlot = c.getPlayer().getInventory(type).addItem(nItem);
/*  164 */             if (newSlot == -1) {
/*  165 */               c.announce(InventoryPacket.getInventoryFull());
/*  166 */               c.announce(InventoryPacket.getShowInventoryFull());
/*  167 */               return -1;
             }
/*  169 */             if (gmLog != null) {
/*  170 */               nItem.setGMLog(gmLog);
             }
/*  172 */             if (owner != null) {
/*  173 */               nItem.setOwner(owner);
             }
/*  175 */             if (period > 0L) {
/*  176 */               if (period < 1000L) {
/*  177 */                 nItem.setExpiration(System.currentTimeMillis() + period * 24L * 60L * 60L * 1000L);
               } else {
/*  179 */                 nItem.setExpiration(System.currentTimeMillis() + period);
               }
             }
/*  182 */             if (pet != null) {
/*  183 */               nItem.setPet(pet);
/*  184 */               pet.setInventoryPosition(newSlot);
             }
/*  186 */             c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, nItem))));
/*  187 */             if (ItemConstants.isRechargable(itemId) && quantity == 0)
               break;
             continue;
           }
/*  191 */           c.getPlayer().havePartyQuest(itemId);
/*  192 */           c.announce(MaplePacketCreator.enableActions());
/*  193 */           return (byte)newSlot;
         }

       } else {

/*  198 */         Item nItem = new Item(itemId, (short)0, quantity, (short)0, uniqueid, (short)0);
/*  199 */         newSlot = c.getPlayer().getInventory(type).addItem(nItem);
/*  200 */         if (newSlot == -1) {
/*  201 */           c.announce(InventoryPacket.getInventoryFull());
/*  202 */           c.announce(InventoryPacket.getShowInventoryFull());
/*  203 */           return -1;
         }
/*  205 */         if (period > 0L) {
/*  206 */           if (period < 1000L) {
/*  207 */             nItem.setExpiration(System.currentTimeMillis() + period * 24L * 60L * 60L * 1000L);
           } else {
/*  209 */             nItem.setExpiration(System.currentTimeMillis() + period);
           }
         }
/*  212 */         if (gmLog != null) {
/*  213 */           nItem.setGMLog(gmLog);
         }
/*  215 */         c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, nItem))));
       }

     }
/*  219 */     else if (quantity == 1) {
/*  220 */       Item nEquip = ii.getEquipById(itemId, uniqueid);
/*  221 */       if (owner != null) {
/*  222 */         nEquip.setOwner(owner);
       }
/*  224 */       if (gmLog != null) {
/*  225 */         nEquip.setGMLog(gmLog);
       }
/*  227 */       if (period > 0L) {
/*  228 */         if (period < 1000L) {
/*  229 */           nEquip.setExpiration(System.currentTimeMillis() + period * 24L * 60L * 60L * 1000L);
         } else {
/*  231 */           nEquip.setExpiration(System.currentTimeMillis() + period);
         }
       }
/*  234 */       if (state > 0) {
/*  235 */         ii.setPotentialState((Equip)nEquip, state);
       }
/*  237 */       if (nEquip.hasSetOnlyId()) {
/*  238 */         nEquip.setEquipOnlyId(MapleEquipOnlyId.getInstance().getNextEquipOnlyId());
       }
/*  240 */       newSlot = c.getPlayer().getInventory(type).addItem(nEquip);
/*  241 */       if (newSlot == -1) {
/*  242 */         c.announce(InventoryPacket.getInventoryFull());
/*  243 */         c.announce(InventoryPacket.getShowInventoryFull());
/*  244 */         return -1;
       }
/*  246 */       c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, nEquip))));
/*  247 */       if (ItemConstants.isHarvesting(itemId)) {
/*  248 */         c.getPlayer().getStat().handleProfessionTool(c.getPlayer());
       }
/*  250 */       c.getPlayer().checkCopyItems();
     } else {
/*  252 */       throw new InventoryException("Trying to create equip with non-one quantity");
     }

/*  255 */     c.getPlayer().havePartyQuest(itemId);
/*  256 */     return (byte)newSlot;
   }

   public static Item addbyId_Gachapon(MapleClient c, int itemId, short quantity) {
/*  260 */     return addbyId_Gachapon(c, itemId, quantity, null, 0L);
   }

   public static Item addbyId_Gachapon(MapleClient c, int itemId, short quantity, String gmLog) {
/*  264 */     return addbyId_Gachapon(c, itemId, quantity, null, 0L);
   }

   public static Item addbyId_Gachapon(MapleClient c, int itemId, short quantity, String gmLog, long period) {
/*  268 */     if (c.getPlayer().getInventory(MapleInventoryType.EQUIP).getNextFreeSlot() == -1 || c.getPlayer().getInventory(MapleInventoryType.USE).getNextFreeSlot() == -1 || c.getPlayer().getInventory(MapleInventoryType.ETC).getNextFreeSlot() == -1 || c.getPlayer().getInventory(MapleInventoryType.SETUP).getNextFreeSlot() == -1) {
/*  269 */       return null;
     }
/*  271 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/*  272 */     if ((ii.isPickupRestricted(itemId) && c.getPlayer().haveItem(itemId, 1, true, false)) || !ii.itemExists(itemId)) {
/*  273 */       c.announce(InventoryPacket.getInventoryFull());
/*  274 */       c.announce(InventoryPacket.showItemUnavailable());
/*  275 */       return null;
     }
/*  277 */     MapleInventoryType type = ItemConstants.getInventoryType(itemId);
/*  278 */     if (!type.equals(MapleInventoryType.EQUIP)) {
/*  279 */       short slotMax = ii.getSlotMax(itemId);
/*  280 */       List<Item> existing = c.getPlayer().getInventory(type).listById(itemId);
/*  281 */       if (!ItemConstants.isRechargable(itemId)) {
/*  282 */         Item nItem = null;
/*  283 */         boolean recieved = false;
/*  284 */         if (existing.size() > 0) {
/*  285 */           Iterator<Item> i = existing.iterator();
/*  286 */           while (quantity > 0 && 
/*  287 */             i.hasNext()) {
/*  288 */             nItem = i.next();
/*  289 */             short oldQ = nItem.getQuantity();
/*  290 */             if (oldQ < slotMax) {
/*  291 */               recieved = true;
/*  292 */               short newQ = (short)Math.min(oldQ + quantity, slotMax);
/*  293 */               quantity = (short)(quantity - newQ - oldQ);
/*  294 */               nItem.setQuantity(newQ);
/*  295 */               c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(1, nItem))));
             }
           }
         }




/*  303 */         while (quantity > 0) {
/*  304 */           short newQ = (short)Math.min(quantity, slotMax);
/*  305 */           if (newQ != 0) {
/*  306 */             quantity = (short)(quantity - newQ);
/*  307 */             nItem = new Item(itemId, (short)0, newQ, (short)0);
/*  308 */             short newSlot = c.getPlayer().getInventory(type).addItem(nItem);
/*  309 */             if (newSlot == -1 && recieved)
/*  310 */               return nItem; 
/*  311 */             if (newSlot == -1) {
/*  312 */               return null;
             }
/*  314 */             recieved = true;
/*  315 */             if (gmLog != null) {
/*  316 */               nItem.setGMLog(gmLog);
             }
/*  318 */             if (period > 0L) {
/*  319 */               if (period < 1000L) {
/*  320 */                 nItem.setExpiration(System.currentTimeMillis() + period * 24L * 60L * 60L * 1000L);
               } else {
/*  322 */                 nItem.setExpiration(System.currentTimeMillis() + period);
               }
             }
/*  325 */             c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, nItem))));
/*  326 */             if (ItemConstants.isRechargable(itemId) && quantity == 0) {
               break;
             }
           }
         }


/*  333 */         if (recieved && nItem != null) {
/*  334 */           c.getPlayer().havePartyQuest(nItem.getItemId());
/*  335 */           return nItem;
         }
       } else {

/*  339 */         Item nItem = new Item(itemId, (short)0, quantity, (short)0);
/*  340 */         short newSlot = c.getPlayer().getInventory(type).addItem(nItem);
/*  341 */         if (newSlot == -1) {
/*  342 */           return null;
         }
/*  344 */         if (gmLog != null) {
/*  345 */           nItem.setGMLog(gmLog);
         }
/*  347 */         if (period > 0L) {
/*  348 */           if (period < 1000L) {
/*  349 */             nItem.setExpiration(System.currentTimeMillis() + period * 24L * 60L * 60L * 1000L);
           } else {
/*  351 */             nItem.setExpiration(System.currentTimeMillis() + period);
           }
         }
/*  354 */         c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, nItem))));
/*  355 */         c.getPlayer().havePartyQuest(nItem.getItemId());
/*  356 */         return nItem;
       }
     } else {

/*  360 */       if (quantity == 1) {
/*  361 */         Equip equip = ii.randomizeStats((Equip)ii.getEquipById(itemId));
/*  362 */         short newSlot = c.getPlayer().getInventory(type).addItem((Item)equip);
/*  363 */         if (newSlot == -1) {
/*  364 */           return null;
         }
/*  366 */         if (gmLog != null) {
/*  367 */           equip.setGMLog(gmLog);
         }
/*  369 */         if (period > 0L) {
/*  370 */           if (period < 1000L) {
/*  371 */             equip.setExpiration(System.currentTimeMillis() + period * 24L * 60L * 60L * 1000L);
           } else {
/*  373 */             equip.setExpiration(System.currentTimeMillis() + period);
           }
         }
/*  376 */         if (equip.hasSetOnlyId()) {
/*  377 */           equip.setEquipOnlyId(MapleEquipOnlyId.getInstance().getNextEquipOnlyId());
         }
/*  379 */         c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, (Item)equip))));
/*  380 */         c.getPlayer().havePartyQuest(equip.getItemId());
/*  381 */         return (Item)equip;
       }
/*  383 */       throw new InventoryException("Trying to create equip with non-one quantity");
     }

/*  386 */     return null;
   }

   public static boolean addFromDrop(MapleClient c, Item item, boolean show) {
/*  390 */     return addFromDrop(c, item, show, false);
   }

   public static boolean addFromDrop(MapleClient c, Item item, boolean show, boolean enhance) {
/*  394 */     return addFromDrop(c, item, show, enhance, true);
   }

   public static boolean addFromDrop(MapleClient c, Item item, boolean show, boolean enhance, boolean updateTick) {
/*  398 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/*  399 */     if (c.getPlayer() == null || (ii.isPickupRestricted(item.getItemId()) && c.getPlayer().haveItem(item.getItemId(), 1, true, false)) || !ii.itemExists(item.getItemId())) {
/*  400 */       c.announce(InventoryPacket.getInventoryFull());
/*  401 */       c.announce(InventoryPacket.showItemUnavailable());
/*  402 */       return false;
     }
/*  404 */     int before = c.getPlayer().itemQuantity(item.getItemId());
/*  405 */     short quantity = item.getQuantity();
/*  406 */     MapleInventoryType type = ItemConstants.getInventoryType(item.getItemId());
/*  407 */     if (!type.equals(MapleInventoryType.EQUIP)) {
/*  408 */       short slotMax = ii.getSlotMax(item.getItemId());
/*  409 */       List<Item> existing = c.getPlayer().getInventory(type).listById(item.getItemId());
/*  410 */       if (!ItemConstants.isRechargable(item.getItemId())) {
/*  411 */         if (quantity <= 0) {
/*  412 */           c.announce(InventoryPacket.getInventoryFull());
/*  413 */           c.announce(InventoryPacket.showItemUnavailable());
/*  414 */           return false;
         }
/*  416 */         if (existing.size() > 0) {
/*  417 */           Iterator<Item> i = existing.iterator();
/*  418 */           while (quantity > 0 && 
/*  419 */             i.hasNext()) {
/*  420 */             Item eItem = i.next();
/*  421 */             short oldQ = eItem.getQuantity();
/*  422 */             if (oldQ < slotMax && item.getOwner().equals(eItem.getOwner()) && item.getExpiration() == eItem.getExpiration() && item.getFamiliarCard() == null) {
/*  423 */               short newQ = (short)Math.min(oldQ + quantity, slotMax);
/*  424 */               quantity = (short)(quantity - newQ - oldQ);
/*  425 */               eItem.setQuantity(newQ);
/*  426 */               eItem.setUniqueId(item.getUniqueId());
/*  427 */               c.announce(InventoryPacket.modifyInventory(updateTick, Collections.singletonList(new ModifyInventory(1, eItem))));
             }
           }
         }




/*  435 */         while (quantity > 0) {
/*  436 */           short newQ = (short)Math.min(quantity, slotMax);
/*  437 */           quantity = (short)(quantity - newQ);
/*  438 */           Item nItem = new Item(item.getItemId(), (short)0, newQ, item.getFlag());
/*  439 */           nItem.setExpiration(item.getExpiration());
/*  440 */           nItem.setOwner(item.getOwner());
/*  441 */           nItem.setPet(item.getPet());
/*  442 */           nItem.setGMLog(item.getGMLog());
/*  443 */           nItem.setFamiliarCard(item.getFamiliarCard());
/*  444 */           nItem.setFamiliarid(item.getFamiliarid());
/*  445 */           if (item.getUniqueId() != -1) {
/*  446 */             nItem.setUniqueId(item.getUniqueId());
           }
/*  448 */           short newSlot = c.getPlayer().getInventory(type).addItem(nItem);
/*  449 */           if (newSlot == -1) {
/*  450 */             c.announce(InventoryPacket.getInventoryFull());
/*  451 */             c.announce(InventoryPacket.getShowInventoryFull());
/*  452 */             item.setQuantity((short)(quantity + newQ));
/*  453 */             return false;
           }
/*  455 */           c.announce(InventoryPacket.modifyInventory(updateTick, Collections.singletonList(new ModifyInventory(0, nItem))));
         }
       } else {

/*  459 */         Item nItem = new Item(item.getItemId(), (short)0, quantity, item.getFlag());
/*  460 */         nItem.setExpiration(item.getExpiration());
/*  461 */         nItem.setOwner(item.getOwner());
/*  462 */         nItem.setPet(item.getPet());
/*  463 */         nItem.setGMLog(item.getGMLog());
/*  464 */         nItem.setFamiliarCard(item.getFamiliarCard());
/*  465 */         nItem.setFamiliarid(item.getFamiliarid());
/*  466 */         if (item.getUniqueId() != -1) {
/*  467 */           nItem.setUniqueId(item.getUniqueId());
         }
/*  469 */         short newSlot = c.getPlayer().getInventory(type).addItem(nItem);
/*  470 */         if (newSlot == -1) {
/*  471 */           c.announce(InventoryPacket.getInventoryFull());
/*  472 */           c.announce(InventoryPacket.getShowInventoryFull());
/*  473 */           return false;
         }
/*  475 */         c.announce(InventoryPacket.modifyInventory(updateTick, Collections.singletonList(new ModifyInventory(0, nItem))));
/*  476 */         c.announce(MaplePacketCreator.enableActions());
       }

     }
/*  480 */     else if (quantity == 1) {
/*  481 */       if (enhance) {
/*  482 */         item = checkEnhanced(item, c.getPlayer());
       }
/*  484 */       if (item.hasSetOnlyId()) {
/*  485 */         item.setEquipOnlyId(MapleEquipOnlyId.getInstance().getNextEquipOnlyId());
       }
/*  487 */       short newSlot = c.getPlayer().getInventory(type).addItem(item);
/*  488 */       if (newSlot == -1) {
/*  489 */         c.announce(InventoryPacket.getInventoryFull());
/*  490 */         c.announce(InventoryPacket.getShowInventoryFull());
/*  491 */         return false;
       }
/*  493 */       c.announce(InventoryPacket.modifyInventory(updateTick, Collections.singletonList(new ModifyInventory(0, item))));
/*  494 */       if (ItemConstants.isHarvesting(item.getItemId())) {
/*  495 */         c.getPlayer().getStat().handleProfessionTool(c.getPlayer());
       }
/*  497 */       c.getPlayer().checkCopyItems();
     } else {
/*  499 */       throw new RuntimeException("玩家[" + c.getPlayer().getName() + "] 获得装备但装备的数量不为1 装备ID: " + item.getItemId());
     }

/*  502 */     if (item.getQuantity() >= 50 && item.getItemId() == 2340000) {
/*  503 */       c.setMonitored(true);
     }
/*  505 */     if (before == 0) {
/*  506 */       switch (item.getItemId()) {

       }








     }
/*  518 */     c.getPlayer().havePartyQuest(item.getItemId());
/*  519 */     if (show) {
/*  520 */       c.announce(MaplePacketCreator.getShowItemGain(item.getItemId(), item.getQuantity()));
     }
/*  522 */     return true;
   }

   public static boolean addItemAndEquip(MapleClient c, int itemId, short slot) {
/*  526 */     return addItemAndEquip(c, itemId, slot, 0);
   }

   public static boolean addItemAndEquip(MapleClient c, int itemId, short slot, boolean removeItem) {
/*  530 */     return addItemAndEquip(c, itemId, slot, 0, removeItem);
   }

   public static boolean addItemAndEquip(MapleClient c, int itemId, short slot, int state) {
/*  534 */     return addItemAndEquip(c, itemId, slot, state, true);
   }

   public static boolean addItemAndEquip(MapleClient c, int itemId, short slot, int state, boolean removeItem) {
/*  538 */     return addItemAndEquip(c, itemId, slot, null, 0L, state, "系统赠送 时间: " + DateUtil.getCurrentDate(), removeItem);
   }

   public static boolean addItemAndEquip(MapleClient c, int itemId, short slot, int state, String gmLog) {
/*  542 */     return addItemAndEquip(c, itemId, slot, null, 0L, state, gmLog, true);
   }












   public static boolean addItemAndEquip(MapleClient c, int itemId, short slot, String owner, long period, int state, String gmLog, boolean removeItem) {
/*  557 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/*  558 */     MapleInventoryType type = ItemConstants.getInventoryType(itemId);
/*  559 */     if (!ii.itemExists(itemId) || slot > 0 || !type.equals(MapleInventoryType.EQUIP)) {
/*  560 */       c.announce(MaplePacketCreator.enableActions());
/*  561 */       return false;
     }
/*  563 */     Item toRemove = c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).getItem(slot);
/*  564 */     if (toRemove != null) {
/*  565 */       if (removeItem) {
/*  566 */         removeFromSlot(c, MapleInventoryType.EQUIPPED, toRemove.getPosition(), toRemove.getQuantity(), false);
       } else {
/*  568 */         short nextSlot = c.getPlayer().getInventory(MapleInventoryType.EQUIP).getNextFreeSlot();
/*  569 */         if (nextSlot > -1) {
/*  570 */           unequip(c, toRemove.getPosition(), nextSlot);
         }
       }
     }
/*  574 */     Item nEquip = ii.getEquipById(itemId);
/*  575 */     if (owner != null) {
/*  576 */       nEquip.setOwner(owner);
     }
/*  578 */     if (gmLog != null) {
/*  579 */       nEquip.setGMLog(gmLog);
     }
/*  581 */     if (period > 0L) {
/*  582 */       if (period < 1000L) {
/*  583 */         nEquip.setExpiration(System.currentTimeMillis() + period * 24L * 60L * 60L * 1000L);
       } else {
/*  585 */         nEquip.setExpiration(System.currentTimeMillis() + period);
       }
     }
/*  588 */     if (state > 0) {
/*  589 */       ii.setPotentialState((Equip)nEquip, state);
     }
/*  591 */     if (nEquip.hasSetOnlyId()) {
/*  592 */       nEquip.setEquipOnlyId(MapleEquipOnlyId.getInstance().getNextEquipOnlyId());
     }
/*  594 */     nEquip.setPosition(slot);
/*  595 */     c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).addFromDB(nEquip);
/*  596 */     c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, nEquip))));
/*  597 */     return true;
   }

   private static Item checkEnhanced(Item before, MapleCharacter chr) {
/*  601 */     if (before instanceof Equip) {
/*  602 */       Equip eq = (Equip)before;
/*  603 */       if (eq.getState(false) == 0 && (eq.getUpgradeSlots() >= 1 || eq.getLevel() >= 1) && ItemConstants.canScroll(eq.getItemId()) && Randomizer.nextInt(100) >= 90) {
/*  604 */         eq.renewPotential(false);
       }
     }

/*  608 */     return before;
   }

   public static boolean checkSpace(MapleClient c, int itemid, int quantity, String owner) {
/*  612 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/*  613 */     if (c.getPlayer() == null || (ii.isPickupRestricted(itemid) && c.getPlayer().haveItem(itemid, 1, true, false)) || !ii.itemExists(itemid)) {
/*  614 */       c.announce(MaplePacketCreator.enableActions());
/*  615 */       return false;
     }
/*  617 */     if (quantity <= 0 && !ItemConstants.isRechargable(itemid)) {
/*  618 */       return false;
     }
/*  620 */     MapleInventoryType type = ItemConstants.getInventoryType(itemid);
/*  621 */     if (c == null || c.getPlayer() == null || c.getPlayer().getInventory(type) == null) {
/*  622 */       return false;
     }
/*  624 */     if (!type.equals(MapleInventoryType.EQUIP)) {
/*  625 */       int numSlotsNeeded; short slotMax = ii.getSlotMax(itemid);
/*  626 */       List<Item> existing = c.getPlayer().getInventory(type).listById(itemid);
/*  627 */       if (!ItemConstants.isRechargable(itemid) && 
/*  628 */         existing.size() > 0) {
/*  629 */         for (Item eItem : existing) {
/*  630 */           short oldQ = eItem.getQuantity();
/*  631 */           if (oldQ < slotMax && owner != null && owner.equals(eItem.getOwner())) {
/*  632 */             short newQ = (short)Math.min(oldQ + quantity, slotMax);
/*  633 */             quantity -= newQ - oldQ;
           }
/*  635 */           if (quantity <= 0) {
             break;
           }
         }
       }



/*  643 */       if (slotMax > 0 && !ItemConstants.isRechargable(itemid)) {
/*  644 */         numSlotsNeeded = (int)Math.ceil(quantity / slotMax);
       } else {
/*  646 */         numSlotsNeeded = 1;
       }
/*  648 */       return !c.getPlayer().getInventory(type).isFull(numSlotsNeeded - 1);
     }
/*  650 */     return !c.getPlayer().getInventory(type).isFull();
   }


   public static void addItemList(MapleClient c, List<Item> items, boolean bl2) {
/*  655 */     if (c.getPlayer() == null) {
       return;
     }
/*  658 */     ArrayList<ModifyInventory> mods = new ArrayList<>();
/*  659 */     items.forEach(item -> mods.add(new ModifyInventory(0, item)));
/*  660 */     c.getPlayer().equipChanged();
/*  661 */     c.announce(InventoryPacket.modifyInventory(bl2, mods));
   }

   public static boolean removeFromSlot(MapleClient c, MapleInventoryType type, short slot, short quantity, boolean fromDrop) {
/*  665 */     return removeFromSlot(c, type, slot, quantity, fromDrop, false);
   }

   public static boolean removeFromSlot(MapleClient c, MapleInventoryType type, short slot, short quantity, boolean fromDrop, boolean consume) {
/*  669 */     if (c.getPlayer() == null || c.getPlayer().getInventory(type) == null) {
/*  670 */       return false;
     }
/*  672 */     Item item = c.getPlayer().getInventory(type).getItem(slot);
/*  673 */     if (item != null) {




/*  678 */       if ((item.getItemId() == 5370000 || item.getItemId() == 5370001) && c.getPlayer().getChalkboard() != null) {
/*  679 */         c.getPlayer().setChalkboard(null);
       }
/*  681 */       boolean allowZero = (consume && ItemConstants.isRechargable(item.getItemId()));
/*  682 */       c.getPlayer().getInventory(type).removeItem(slot, quantity, allowZero);
/*  683 */       if (ItemConstants.isHarvesting(item.getItemId())) {
/*  684 */         c.getPlayer().getStat().handleProfessionTool(c.getPlayer());
       }
/*  686 */       if (item.getQuantity() == 0 && !allowZero) {
/*  687 */         c.announce(InventoryPacket.modifyInventory(fromDrop, Collections.singletonList(new ModifyInventory(3, item))));
       } else {
/*  689 */         c.announce(InventoryPacket.modifyInventory(fromDrop, Collections.singletonList(new ModifyInventory(1, item))));
       }
/*  691 */       return true;
     }
/*  693 */     return false;
   }

   public static boolean removeById(MapleClient c, MapleInventoryType type, int itemId, int quantity, boolean fromDrop, boolean consume) {
/*  697 */     int remremove = quantity;
/*  698 */     if (c.getPlayer() == null || c.getPlayer().getInventory(type) == null) {
/*  699 */       return false;
     }
/*  701 */     for (Item item : c.getPlayer().getInventory(type).listById(itemId)) {
/*  702 */       int theQ = item.getQuantity();
/*  703 */       if (remremove <= theQ && removeFromSlot(c, type, item.getPosition(), (short)remremove, fromDrop, consume)) {
/*  704 */         remremove = 0; break;
       }
/*  706 */       if (remremove > theQ && removeFromSlot(c, type, item.getPosition(), item.getQuantity(), fromDrop, consume)) {
/*  707 */         remremove -= theQ;
       }
     }
/*  710 */     return (remremove <= 0);
   }

   public static boolean removeFromSlot_Lock(MapleClient c, MapleInventoryType type, short slot, short quantity, boolean fromDrop, boolean consume) {
/*  714 */     if (c.getPlayer() == null || c.getPlayer().getInventory(type) == null) {
/*  715 */       return false;
     }
/*  717 */     Item item = c.getPlayer().getInventory(type).getItem(slot);
/*  718 */     if (item != null) {
/*  719 */       return (!ItemFlag.封印.check(item.getFlag()) && !ItemFlag.不可交易.check(item.getFlag()) && removeFromSlot(c, type, slot, quantity, fromDrop, consume));
     }
/*  721 */     return false;
   }

   public static boolean removeById_Lock(MapleClient c, MapleInventoryType type, int itemId) {
/*  725 */     for (Item item : c.getPlayer().getInventory(type).listById(itemId)) {
/*  726 */       if (removeFromSlot_Lock(c, type, item.getPosition(), (short)1, false, false)) {
/*  727 */         return true;
       }
     }
/*  730 */     return false;
   }

   public static void removeAllById(MapleClient c, int itemId, boolean checkEquipped) {
/*  734 */     MapleInventoryType type = ItemConstants.getInventoryType(itemId);
/*  735 */     for (Item item : c.getPlayer().getInventory(type).listById(itemId)) {
/*  736 */       if (item != null) {
/*  737 */         removeFromSlot(c, type, item.getPosition(), item.getQuantity(), true, false);
       }
     }
/*  740 */     if (checkEquipped) {
/*  741 */       Item ii = c.getPlayer().getInventory(type).findById(itemId);
/*  742 */       if (ii != null) {
/*  743 */         c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).removeItem(ii.getPosition());
/*  744 */         c.getPlayer().equipChanged();
       }
     }
   }

   public static void removeAll(MapleClient c, MapleInventoryType type) {
/*  750 */     List<ModifyInventory> mods = new ArrayList<>();
/*  751 */     for (Item item : c.getPlayer().getInventory(type).list()) {
/*  752 */       if (item != null) {
/*  753 */         mods.add(new ModifyInventory(3, item));
       }
     }
/*  756 */     if (!mods.isEmpty()) {
/*  757 */       c.announce(InventoryPacket.modifyInventory(false, mods));
     }
/*  759 */     c.getPlayer().getInventory(type).removeAll();
   }

   public static void removeAllByEquipOnlyId(MapleClient c, int equipOnlyId) {
/*  763 */     if (c.getPlayer() == null) {
       return;
     }
/*  766 */     boolean locked = false;
/*  767 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();

/*  769 */     List<Item> copyEquipItems = c.getPlayer().getInventory(MapleInventoryType.EQUIP).listByEquipOnlyId(equipOnlyId);
/*  770 */     for (Item item : copyEquipItems) {
/*  771 */       if (item != null) {
/*  772 */         if (!locked) {
/*  773 */           short flag = item.getFlag();
/*  774 */           flag = (short)(flag | ItemFlag.封印.getValue());
/*  775 */           flag = (short)(flag | ItemFlag.不可交易.getValue());
/*  776 */           flag = (short)(flag | ItemFlag.CRAFTED.getValue());
/*  777 */           item.setFlag(flag);
/*  778 */           item.setOwner("复制装备");
/*  779 */           c.getPlayer().forceUpdateItem(item);
/*  780 */           c.getPlayer().dropMessage(-11, "在背包中发现复制装备[" + ii.getName(item.getItemId()) + "]已经将其锁定。");
/*  781 */           String msgtext = "玩家 " + c.getPlayer().getName() + " ID: " + c.getPlayer().getId() + " (等级 " + c.getPlayer().getLevel() + ") 地图: " + c.getPlayer().getMapId() + " 在玩家背包中发现复制装备[" + ii.getName(item.getItemId()) + "]已经将其锁定。";
/*  782 */           WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] " + msgtext));
/*  783 */           log.warn(msgtext + " 道具唯一ID: " + item.getEquipOnlyId());
/*  784 */           locked = true; continue;
         }
/*  786 */         removeFromSlot(c, MapleInventoryType.EQUIP, item.getPosition(), item.getQuantity(), true, false);
/*  787 */         c.getPlayer().dropMessage(-11, "在背包中发现复制装备[" + ii.getName(item.getItemId()) + "]已经将其删除。");
       }
     }


/*  792 */     List<Item> copyEquipedItems = c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).listByEquipOnlyId(equipOnlyId);
/*  793 */     for (Item item : copyEquipedItems) {
/*  794 */       if (item != null) {
/*  795 */         if (!locked) {
/*  796 */           short flag = item.getFlag();
/*  797 */           flag = (short)(flag | ItemFlag.封印.getValue());
/*  798 */           flag = (short)(flag | ItemFlag.不可交易.getValue());
/*  799 */           flag = (short)(flag | ItemFlag.CRAFTED.getValue());
/*  800 */           item.setFlag(flag);
/*  801 */           item.setOwner("复制装备");
/*  802 */           c.getPlayer().forceUpdateItem(item);
/*  803 */           c.getPlayer().dropMessage(-11, "在穿戴中发现复制装备[" + ii.getName(item.getItemId()) + "]已经将其锁定。");
/*  804 */           String msgtext = "玩家 " + c.getPlayer().getName() + " ID: " + c.getPlayer().getId() + " (等级 " + c.getPlayer().getLevel() + ") 地图: " + c.getPlayer().getMapId() + " 在玩家穿戴中发现复制装备[" + ii.getName(item.getItemId()) + "]已经将其锁定。";
/*  805 */           WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] " + msgtext));
/*  806 */           log.warn(msgtext + " 道具唯一ID: " + item.getEquipOnlyId());
/*  807 */           locked = true; continue;
         }
/*  809 */         removeFromSlot(c, MapleInventoryType.EQUIPPED, item.getPosition(), item.getQuantity(), true, false);
/*  810 */         c.getPlayer().dropMessage(-11, "在穿戴中发现复制装备[" + ii.getName(item.getItemId()) + "]已经将其删除。");
/*  811 */         c.getPlayer().equipChanged();
       }
     }
   }


   public static void move(MapleClient c, MapleInventoryType type, short src, short dst) {
/*  818 */     if (src < 0 || dst < 0 || src == dst || type == MapleInventoryType.EQUIPPED) {
       return;
     }
/*  821 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/*  822 */     Item source = c.getPlayer().getInventory(type).getItem(src);
/*  823 */     Item initialTarget = c.getPlayer().getInventory(type).getItem(dst);
/*  824 */     if (source == null) {
/*  825 */       c.getPlayer().dropMessage(1, "移动道具失败，找不到移动道具的信息。");
/*  826 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  829 */     boolean bag = false, switchSrcDst = false, bothBag = false;
/*  830 */     short eqIndicator = -1;
/*  831 */     List<ModifyInventory> mods = new ArrayList<>();
/*  832 */     if (dst > c.getPlayer().getInventory(type).getSlotLimit()) {
/*  833 */       if ((type == MapleInventoryType.ETC || type == MapleInventoryType.SETUP || type == MapleInventoryType.USE) && dst > 10000 && dst % 10000 != 0) {
/*  834 */         int eSlot = c.getPlayer().getExtendedSlot(MapleInventoryType.ETC.getType(), dst / 10000 - 1);
/*  835 */         if (eSlot > 0) {
/*  836 */           MapleStatEffect itemEffect = ii.getItemEffect(eSlot);
/*  837 */           if (dst % 100 > itemEffect.getSlotCount() || itemEffect.getType() <= 0 || (itemEffect.getType() != ii.getBagType(source.getItemId()) && source.getItemId() / 10000 != 301 && source.getItemId() / 10000 != 251)) {
/*  838 */             c.getPlayer().dropMessage(1, "无法将该道具移动到小背包.");
/*  839 */             c.announce(MaplePacketCreator.enableActions());
             return;
           }
/*  842 */           eqIndicator = 0;
/*  843 */           bag = true;
         } else {

/*  846 */           c.getPlayer().dropMessage(1, "无法将该道具移动到小背包.");
/*  847 */           c.announce(MaplePacketCreator.enableActions());
           return;
         }
       } else {
/*  851 */         c.getPlayer().dropMessage(1, "无法进行此操作.");
/*  852 */         c.announce(MaplePacketCreator.enableActions());
         return;
       }
     }
/*  856 */     if (src > c.getPlayer().getInventory(type).getSlotLimit() && (type == MapleInventoryType.ETC || type == MapleInventoryType.SETUP || type == MapleInventoryType.USE) && src > 10000 && src % 10000 != 0)
     {
/*  858 */       if (!bag) {
/*  859 */         switchSrcDst = true;
/*  860 */         eqIndicator = 0;
/*  861 */         bag = true;
       } else {
/*  863 */         bothBag = true;
       }
     }
/*  866 */     short olddstQ = -1;
/*  867 */     if (initialTarget != null) {
/*  868 */       olddstQ = initialTarget.getQuantity();
     }
/*  870 */     short oldsrcQ = source.getQuantity();
/*  871 */     short slotMax = ii.getSlotMax(source.getItemId());
/*  872 */     c.getPlayer().getInventory(type).move(src, dst, slotMax);
/*  873 */     if (ItemConstants.isHarvesting(source.getItemId())) {
/*  874 */       c.getPlayer().getStat().handleProfessionTool(c.getPlayer());
     }
/*  876 */     if (!type.equals(MapleInventoryType.EQUIP) && initialTarget != null && initialTarget.getItemId() == source.getItemId() && initialTarget.getOwner().equals(source.getOwner()) && initialTarget.getExpiration() == source.getExpiration() && !ItemConstants.isRechargable(source.getItemId()) && !type.equals(MapleInventoryType.CASH)) {
/*  877 */       if (olddstQ + oldsrcQ > slotMax) {
/*  878 */         mods.add(new ModifyInventory((bag && (switchSrcDst || bothBag)) ? 6 : 1, source));
/*  879 */         mods.add(new ModifyInventory((bag && (switchSrcDst || bothBag)) ? 6 : 1, initialTarget));
       } else {
/*  881 */         mods.add(new ModifyInventory((bag && (switchSrcDst || bothBag)) ? 7 : 3, source));
/*  882 */         mods.add(new ModifyInventory((bag && (!switchSrcDst || bothBag)) ? 6 : 1, initialTarget));
       }
     } else {
/*  885 */       mods.add(new ModifyInventory(bag ? (bothBag ? 8 : 5) : 2, source, src, eqIndicator, switchSrcDst));
     }
/*  887 */     c.announce(InventoryPacket.modifyInventory(true, mods));
   }
   public static void equip(MapleClient c, short src, short dst) {
     Item top, weapon, shield, bottom;
/*  891 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/*  892 */     MapleCharacter chr = c.getPlayer();
/*  893 */     if (chr == null) {
       return;
     }
/*  896 */     PlayerStats statst = chr.getStat();
/*  897 */     Equip source = (Equip)chr.getInventory(MapleInventoryType.EQUIP).getItem(src);
/*  898 */     if (source == null || source.getDurability() == 0 || ItemConstants.isHarvesting(source.getItemId())) {
/*  899 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  902 */     if (chr.isAdmin() && ServerConstants.isShowPacket()) {
/*  903 */       chr.dropMessage(5, "穿戴装备  " + source.getItemId() + " src: " + src + " dst: " + dst);
     }








/*  913 */     if ((source.getItemId() == 1003142 || source.getItemId() == 1002140 || source.getItemId() == 1042003 || source.getItemId() == 1062007 || source.getItemId() == 1322013 || source.getItemId() == 1003824) && 
/*  914 */       !chr.isIntern()) {
/*  915 */       chr.dropMessage(1, "无法佩带此物品");
/*  916 */       log.info("[作弊] 非管理员玩家: " + chr.getName() + " 非法穿戴GM装备 " + source.getItemId());
/*  917 */       removeById(c, MapleInventoryType.EQUIP, source.getItemId(), 1, true, false);
/*  918 */       AutobanManager.getInstance().autoban(chr.getClient(), "无理由.");
/*  919 */       c.announce(MaplePacketCreator.enableActions());

       return;
     }
/*  923 */     if (!ii.itemExists(source.getItemId())) {
/*  924 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  927 */     if (dst > -1200 && dst < -999 && !ItemConstants.is龙龙装备(source.getItemId()) && !ItemConstants.is机甲装备(source.getItemId())) {
/*  928 */       if (chr.isAdmin()) {
/*  929 */         chr.dropMessage(5, "穿戴装备 - 1 " + source.getItemId());
       }
/*  931 */       c.announce(MaplePacketCreator.enableActions()); return;
     }
/*  933 */     if (((dst > -6000 && dst < -5003) || (dst >= -999 && dst < -99)) && !ii.isCash(source.getItemId()) && dst != -5200) {
/*  934 */       if (chr.isAdmin()) {
/*  935 */         chr.dropMessage(5, "穿戴装备 - 2 " + source.getItemId() + " dst: " + dst + " 检测1: " + ((dst <= -1200) ? 1 : 0) + " 检测2: " + ((dst >= -999 && dst < -99) ? 1 : 0) + " 检测3: " + (!ii.isCash(source.getItemId()) ? 1 : 0));
       }
/*  937 */       c.announce(MaplePacketCreator.enableActions()); return;
     }
/*  939 */     if (dst <= -1200 && dst > -1300 && chr.getAndroid() == null) {
/*  940 */       if (chr.isAdmin()) {
/*  941 */         chr.dropMessage(5, "穿戴装备 - 3 " + source.getItemId() + " dst: " + dst + " 检测1: " + ((dst <= -1200 && dst > -1300) ? 1 : 0) + " 检测2: " + ((chr.getAndroid() == null) ? 1 : 0));
       }
/*  943 */       c.announce(MaplePacketCreator.enableActions()); return;
     }
/*  945 */     if (dst <= -1300 && dst > -1306 && !JobConstants.is爆莉萌天使(chr.getJob())) {
/*  946 */       if (chr.isAdmin()) {
/*  947 */         chr.dropMessage(5, "穿戴装备 - 4 " + source.getItemId() + " dst: " + dst + " 检测1: " + ((dst <= -1300 && dst > -1306) ? 1 : 0) + " 检测2: " + (!JobConstants.is爆莉萌天使(chr.getJob()) ? 1 : 0));
       }
/*  949 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  952 */     if (!ii.canEquip(source.getItemId(), chr.getLevel(), chr.getJob(), chr.getFame(), statst.getTotalStr(), statst.getTotalDex(), statst.getTotalLuk(), statst.getTotalInt(), (chr.getStat()).levelBonus)) {
/*  953 */       if (ServerConfig.WORLD_EQUIPCHECKFAME && chr.getFame() < 0) {
/*  954 */         chr.dropMessage(1, "人气度小于0，无法穿戴装备。");
       }
/*  956 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  959 */     if (ItemConstants.isWeapon(source.getItemId()) && dst != -10 && dst != -11) {
/*  960 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  963 */     if (dst == -23 && !GameConstants.isMountItemAvailable(source.getItemId(), chr.getJob())) {
/*  964 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  967 */     if (dst == -118 && source.getItemId() / 10000 != 190) {
/*  968 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  971 */     if (dst == -119 && source.getItemId() / 10000 != 191) {
/*  972 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  975 */     if (dst <= -5000 && dst > -5003 && source.getItemId() / 10000 != 120) {
/*  976 */       chr.dropMessage(1, "无法将此装备佩戴这个地方，该位置只能装备图腾道具");
/*  977 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  980 */     if (dst == -33 && source.getItemId() / 10000 != 116) {
/*  981 */       chr.dropMessage(1, "无法将此装备佩戴这个地方，该位置只能装备口袋物品道具");
/*  982 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  985 */     if (dst == -36 && source.getItemId() / 10000 != 118) {
/*  986 */       chr.dropMessage(1, "无法将此装备佩戴这个地方，该位置只能装备徽章道具");
/*  987 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/*  990 */     if (dst == -38) {
/*  991 */       MapleQuestStatus stat = chr.getQuestNoAdd(MapleQuest.getInstance(122700));
/*  992 */       if (stat == null || stat.getCustomData() == null || Long.parseLong(stat.getCustomData()) < System.currentTimeMillis()) {
/*  993 */         c.announce(MaplePacketCreator.enableActions());
         return;
       }
     }
/*  997 */     if (ItemConstants.is双刀副手(source.getItemId()) || source.getItemId() / 10000 == 135) {
/*  998 */       dst = -10;
     }
/* 1000 */     if (ItemConstants.is龙龙装备(source.getItemId()) && JobConstants.is龙神(chr.getJob())) {
/* 1001 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/* 1004 */     if (ItemConstants.is机甲装备(source.getItemId()) && JobConstants.is机械师(chr.getJob())) {
/* 1005 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/* 1008 */     if (ii.isExclusiveEquip(source.getItemId())) {
/* 1009 */       StructExclusiveEquip exclusive = ii.getExclusiveEquipInfo(source.getItemId());
/* 1010 */       if (exclusive != null) {
/* 1011 */         List<Integer> theList = chr.getInventory(MapleInventoryType.EQUIPPED).listIds();
/* 1012 */         for (Integer i : exclusive.itemIDs) {
/* 1013 */           if (theList.contains(i)) {
/* 1014 */             chr.dropMessage(1, exclusive.msg);
/* 1015 */             c.announce(MaplePacketCreator.enableActions());
             return;
           }
         }
       }
     }
/* 1021 */     switch (dst) {
       case -6:
/* 1023 */         top = chr.getInventory(MapleInventoryType.EQUIPPED).getItem((short)-5);
/* 1024 */         if (top != null && ItemConstants.isOverall(top.getItemId())) {
/* 1025 */           if (chr.getInventory(MapleInventoryType.EQUIP).isFull()) {
/* 1026 */             c.announce(InventoryPacket.getInventoryFull());
/* 1027 */             c.announce(InventoryPacket.getShowInventoryFull());
             return;
           }
/* 1030 */           unequip(c, (short)-5, chr.getInventory(MapleInventoryType.EQUIP).getNextFreeSlot());
         }
         break;

       case -5:
/* 1035 */         top = chr.getInventory(MapleInventoryType.EQUIPPED).getItem((short)-5);
/* 1036 */         bottom = chr.getInventory(MapleInventoryType.EQUIPPED).getItem((short)-6);
/* 1037 */         if (top != null && ItemConstants.isOverall(source.getItemId())) {
/* 1038 */           if (chr.getInventory(MapleInventoryType.EQUIP).isFull((bottom != null && ItemConstants.isOverall(source.getItemId())) ? 1 : 0)) {
/* 1039 */             c.announce(InventoryPacket.getInventoryFull());
/* 1040 */             c.announce(InventoryPacket.getShowInventoryFull());
             return;
           }
/* 1043 */           unequip(c, (short)-5, chr.getInventory(MapleInventoryType.EQUIP).getNextFreeSlot());
         }
/* 1045 */         if (bottom != null && ItemConstants.isOverall(source.getItemId())) {
/* 1046 */           if (chr.getInventory(MapleInventoryType.EQUIP).isFull()) {
/* 1047 */             c.announce(InventoryPacket.getInventoryFull());
/* 1048 */             c.announce(InventoryPacket.getShowInventoryFull());
             return;
           }
/* 1051 */           unequip(c, (short)-6, chr.getInventory(MapleInventoryType.EQUIP).getNextFreeSlot());
         }
         break;

       case -10:
/* 1056 */         weapon = chr.getInventory(MapleInventoryType.EQUIPPED).getItem((short)-11);
/* 1057 */         if (ItemConstants.is双刀副手(source.getItemId())) {
/* 1058 */           if ((chr.getJob() != 900 && (chr.getJob() < 430 || chr.getJob() > 434)) || weapon == null || !ItemConstants.is双刀主手(weapon.getItemId())) {
/* 1059 */             c.announce(InventoryPacket.getInventoryFull());
/* 1060 */             c.announce(InventoryPacket.getShowInventoryFull()); return;
           }  break;
         }
/* 1063 */         if (weapon != null && ItemConstants.isTwoHanded(weapon.getItemId(), chr.getJob()) && source.getItemId() / 10000 != 135) {
/* 1064 */           if (chr.getInventory(MapleInventoryType.EQUIP).isFull()) {
/* 1065 */             c.announce(InventoryPacket.getInventoryFull());
/* 1066 */             c.announce(InventoryPacket.getShowInventoryFull());
             return;
           }
/* 1069 */           unequip(c, (short)-11, chr.getInventory(MapleInventoryType.EQUIP).getNextFreeSlot());
         }
         break;

       case -11:
/* 1074 */         shield = chr.getInventory(MapleInventoryType.EQUIPPED).getItem((short)-10);
/* 1075 */         if (shield != null && ItemConstants.isTwoHanded(source.getItemId(), chr.getJob()) && shield.getItemId() / 10000 != 135) {
/* 1076 */           if (chr.getInventory(MapleInventoryType.EQUIP).isFull()) {
/* 1077 */             c.announce(InventoryPacket.getInventoryFull());
/* 1078 */             c.announce(InventoryPacket.getShowInventoryFull());
             return;
           }
/* 1081 */           unequip(c, (short)-10, chr.getInventory(MapleInventoryType.EQUIP).getNextFreeSlot());
         }
         break;
     }

/* 1086 */     source = (Equip)chr.getInventory(MapleInventoryType.EQUIP).getItem(src);
/* 1087 */     Equip target = (Equip)chr.getInventory(MapleInventoryType.EQUIPPED).getItem(dst);
/* 1088 */     if (source == null) {
/* 1089 */       c.announce(MaplePacketCreator.enableActions());
       return;
     }
/* 1092 */     short flag = source.getFlag();
/* 1093 */     boolean itemChanged = false;
/* 1094 */     if ((ii.isEquipTradeBlock(source.getItemId()) || source.getItemId() / 10000 == 167) && 
/* 1095 */       !ItemFlag.不可交易.check(flag)) {
/* 1096 */       flag = (short)(flag | ItemFlag.不可交易.getValue());
/* 1097 */       source.setFlag(flag);
/* 1098 */       itemChanged = true;
     }

/* 1101 */     if (ii.isCash(source.getItemId()) && ItemFlag.可以交换1次.check(flag) && !ItemFlag.不可交易.check(flag)) {
/* 1102 */       flag = (short)((short)(flag | ItemFlag.不可交易.getValue()) - ItemFlag.可以交换1次.getValue());
/* 1103 */       source.setFlag(flag);
/* 1104 */       itemChanged = true;
     }
/* 1106 */     if (source.getItemId() / 10000 == 166) {
/* 1107 */       if (source.getAndroid() == null) {
/* 1108 */         int uid = MapleInventoryIdentifier.getInstance();
/* 1109 */         source.setUniqueId(uid);
/* 1110 */         source.setAndroid(MapleAndroid.create(source.getItemId(), uid));

/* 1112 */         flag = (short)(flag | ItemFlag.不可交易.getValue());
/* 1113 */         flag = (short)(flag | ItemFlag.ANDROID_ACTIVATED.getValue());
/* 1114 */         source.setFlag(flag);
/* 1115 */         itemChanged = true;
       }
/* 1117 */       chr.removeAndroid();
/* 1118 */       chr.setAndroid(source.getAndroid());
/* 1119 */     } else if (chr.getAndroid() != null) {
/* 1120 */       if (dst <= -1300) {
/* 1121 */         chr.setAndroid(chr.getAndroid());
/* 1122 */       } else if (dst <= -1200) {
/* 1123 */         chr.updateAndroid(dst, source.getItemId());
       }
     }
/* 1126 */     if (source.getCharmEXP() > 0 && !ItemFlag.装备时获得魅力.check(flag)) {
/* 1127 */       chr.getTrait(MapleTraitType.charm).addExp(source.getCharmEXP(), chr);
/* 1128 */       source.setCharmEXP((short)0);
/* 1129 */       flag = (short)(flag | ItemFlag.装备时获得魅力.getValue());
/* 1130 */       source.setFlag(flag);
/* 1131 */       itemChanged = true;
     }
/* 1133 */     chr.getInventory(MapleInventoryType.EQUIP).removeSlot(src);
/* 1134 */     if (target != null) {
/* 1135 */       chr.getInventory(MapleInventoryType.EQUIPPED).removeSlot(dst);
     }

/* 1138 */     List<ModifyInventory> mods = new ArrayList<>();
/* 1139 */     if (itemChanged) {
/* 1140 */       mods.add(new ModifyInventory(3, (Item)source));
/* 1141 */       mods.add(new ModifyInventory(0, (Item)source));
     }
/* 1143 */     source.setPosition(dst);
/* 1144 */     chr.getInventory(MapleInventoryType.EQUIPPED).addFromDB((Item)source);
/* 1145 */     if (target != null) {
/* 1146 */       target.setPosition(src);
/* 1147 */       chr.getInventory(MapleInventoryType.EQUIP).addFromDB((Item)target);
     }
/* 1149 */     if (ItemConstants.isWeapon(source.getItemId())) {
/* 1150 */       chr.cancelEffectFromBuffStat(MapleBuffStat.攻击加速);
/* 1151 */       chr.cancelEffectFromBuffStat(MapleBuffStat.暗器伤人);
/* 1152 */       chr.cancelEffectFromBuffStat(MapleBuffStat.无形箭弩);
/* 1153 */       chr.cancelEffectFromBuffStat(MapleBuffStat.属性攻击);
/* 1154 */       chr.cancelEffectFromBuffStat(MapleBuffStat.雷鸣冲击);
/* 1155 */       chr.cancelEffectFromBuffStat(MapleBuffStat.剑刃之壁);
     }
/* 1157 */     if (source.getItemId() / 10000 == 190 || source.getItemId() / 10000 == 191) {
/* 1158 */       chr.cancelEffectFromBuffStat(MapleBuffStat.骑兽技能);
/* 1159 */       chr.cancelEffectFromBuffStat(MapleBuffStat.金属机甲);
/* 1160 */     } else if (GameConstants.isReverseItem(source.getItemId())) {
/* 1161 */       chr.finishAchievement(9);
/* 1162 */     } else if (GameConstants.isTimelessItem(source.getItemId())) {
/* 1163 */       chr.finishAchievement(10);
/* 1164 */     } else if (ii.getReqLevel(source.getItemId()) >= 140) {
/* 1165 */       chr.finishAchievement(41);
/* 1166 */     } else if (ii.getReqLevel(source.getItemId()) >= 130) {
/* 1167 */       chr.finishAchievement(40);
/* 1168 */     } else if (source.getItemId() == 1122017) {
/* 1169 */       chr.startFairySchedule(true, true);
     }
/* 1171 */     if (source.getState(false) >= 17) {
/* 1172 */       Map<Integer, SkillEntry> skills = new HashMap<>();
/* 1173 */       int[] potentials = { source.getPotential1(), source.getPotential2(), source.getPotential3(), source.getPotential4(), source.getPotential5(), source.getPotential6() };
/* 1174 */       for (int i : potentials) {
/* 1175 */         if (i > 0) {
/* 1176 */           int itemReqLevel = ii.getReqLevel(source.getItemId());
/* 1177 */           List<StructItemOption> potentialInfo = ii.getPotentialInfo(i);
/* 1178 */           StructItemOption pot = potentialInfo.get(Math.min(potentialInfo.size() - 1, (itemReqLevel - 1) / 10));
/* 1179 */           if (pot != null && pot.get("skillID") > 0) {
/* 1180 */             skills.put(Integer.valueOf(PlayerStats.getSkillByJob(pot.get("skillID"), chr.getJob())), new SkillEntry(1, (byte)0, -1L));
           }
         }
       }
/* 1184 */       chr.changeSkillLevel_Skip(skills, true);
     }
/* 1186 */     if (source.getSocketState() >= 19) {
/* 1187 */       Map<Integer, SkillEntry> skills = new HashMap<>();
/* 1188 */       int[] sockets = { source.getSocket1(), source.getSocket2(), source.getSocket3() };
/* 1189 */       for (int i : sockets) {
/* 1190 */         if (i > 0) {
/* 1191 */           StructItemOption soc = ii.getSocketInfo(i);
/* 1192 */           if (soc != null && soc.get("skillID") > 0) {
/* 1193 */             skills.put(Integer.valueOf(PlayerStats.getSkillByJob(soc.get("skillID"), chr.getJob())), new SkillEntry(1, (byte)0, -1L));
           }
         }
       }
/* 1197 */       chr.changeSkillLevel_Skip(skills, true);
     }
/* 1199 */     mods.add(new ModifyInventory(2, (Item)source, src));
/* 1200 */     c.announce(InventoryPacket.modifyInventory(true, mods));
/* 1201 */     if (target != null && chr.isSoulWeapon(target)) {
/* 1202 */       chr.unequipSoulWeapon(target);
     }
/* 1204 */     if (chr.isSoulWeapon(source)) {
/* 1205 */       chr.equipSoulWeapon(source);
     }
/* 1207 */     chr.equipChanged();
   }

   public static void unequip(MapleClient c, short src, short dst) {
/* 1211 */     if (c.getPlayer() == null) {
       return;
     }
/* 1214 */     Equip source = (Equip)c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).getItem(src);
/* 1215 */     Equip target = (Equip)c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem(dst);
/* 1216 */     if (dst < 0 || source == null) {
       return;
     }
/* 1219 */     if (target != null && src <= 0) {
/* 1220 */       c.announce(InventoryPacket.getInventoryFull());
       return;
     }
/* 1223 */     c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).removeSlot(src);
/* 1224 */     if (target != null) {
/* 1225 */       c.getPlayer().getInventory(MapleInventoryType.EQUIP).removeSlot(dst);
     }
/* 1227 */     source.setPosition(dst);
/* 1228 */     c.getPlayer().getInventory(MapleInventoryType.EQUIP).addFromDB((Item)source);
/* 1229 */     if (target != null) {
/* 1230 */       target.setPosition(src);
/* 1231 */       c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).addFromDB((Item)target);
     }
/* 1233 */     if (ItemConstants.isWeapon(source.getItemId())) {
/* 1234 */       c.getPlayer().cancelEffectFromBuffStat(MapleBuffStat.攻击加速);
/* 1235 */       c.getPlayer().cancelEffectFromBuffStat(MapleBuffStat.暗器伤人);
/* 1236 */       c.getPlayer().cancelEffectFromBuffStat(MapleBuffStat.无形箭弩);
/* 1237 */       c.getPlayer().cancelEffectFromBuffStat(MapleBuffStat.属性攻击);
/* 1238 */       c.getPlayer().cancelEffectFromBuffStat(MapleBuffStat.雷鸣冲击);
/* 1239 */       c.getPlayer().cancelEffectFromBuffStat(MapleBuffStat.剑刃之壁);
/* 1240 */     } else if (source.getItemId() / 10000 == 190 || source.getItemId() / 10000 == 191) {
/* 1241 */       c.getPlayer().cancelEffectFromBuffStat(MapleBuffStat.骑兽技能);
/* 1242 */       c.getPlayer().cancelEffectFromBuffStat(MapleBuffStat.金属机甲);
/* 1243 */     } else if (source.getItemId() / 10000 == 166) {
/* 1244 */       c.getPlayer().removeAndroid();
/* 1245 */     } else if (source.getItemId() / 10000 == 167 && c.getPlayer().getAndroid() != null) {
/* 1246 */       c.announce(AndroidPacket.removeAndroidHeart());
/* 1247 */       c.getPlayer().removeAndroid();
/* 1248 */     } else if (c.getPlayer().getAndroid() != null) {
/* 1249 */       if (src <= -1300) {
/* 1250 */         c.getPlayer().setAndroid(c.getPlayer().getAndroid());
/* 1251 */       } else if (src <= -1200) {
/* 1252 */         c.getPlayer().updateAndroid(src, 0);
       }
/* 1254 */     } else if (source.getItemId() == 1122017) {
/* 1255 */       c.getPlayer().cancelFairySchedule(true);
     }
/* 1257 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 1258 */     if (source.getState(false) >= 17) {
/* 1259 */       Map<Integer, SkillEntry> skills = new HashMap<>();
/* 1260 */       int[] potentials = { source.getPotential1(), source.getPotential2(), source.getPotential3(), source.getPotential4(), source.getPotential5(), source.getPotential6() };
/* 1261 */       for (int i : potentials) {
/* 1262 */         if (i > 0) {
/* 1263 */           int itemReqLevel = ii.getReqLevel(source.getItemId());
/* 1264 */           List<StructItemOption> potentialInfo = ii.getPotentialInfo(i);
/* 1265 */           StructItemOption pot = potentialInfo.get(Math.min(potentialInfo.size() - 1, (itemReqLevel - 1) / 10));
/* 1266 */           if (pot != null && pot.get("skillID") > 0) {
/* 1267 */             skills.put(Integer.valueOf(PlayerStats.getSkillByJob(pot.get("skillID"), c.getPlayer().getJob())), new SkillEntry(0, (byte)0, -1L));
           }
         }
       }
/* 1271 */       c.getPlayer().changeSkillLevel_Skip(skills, true);
     }
/* 1273 */     if (source.getSocketState() >= 19) {
/* 1274 */       Map<Integer, SkillEntry> skills = new HashMap<>();
/* 1275 */       int[] sockets = { source.getSocket1(), source.getSocket2(), source.getSocket3() };
/* 1276 */       for (int i : sockets) {
/* 1277 */         if (i > 0) {
/* 1278 */           StructItemOption soc = ii.getSocketInfo(i);
/* 1279 */           if (soc != null && soc.get("skillID") > 0) {
/* 1280 */             skills.put(Integer.valueOf(PlayerStats.getSkillByJob(soc.get("skillID"), c.getPlayer().getJob())), new SkillEntry(0, (byte)0, -1L));
           }
         }
       }
/* 1284 */       c.getPlayer().changeSkillLevel_Skip(skills, true);
     }
/* 1286 */     c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(2, (Item)source, src))));
/* 1287 */     if (c.getPlayer().isSoulWeapon(source)) {
/* 1288 */       c.getPlayer().unequipSoulWeapon(source);
     }
/* 1290 */     c.getPlayer().equipChanged();
   }

   public static boolean drop(MapleClient c, MapleInventoryType type, short src, short quantity) {
/* 1294 */     return drop(c, type, src, quantity, false);
   }
























































































   public static boolean drop(MapleClient c, MapleInventoryType type, short src, short quantity, boolean npcInduced) {
/* 1385 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 1386 */     if (src < 0) {
/* 1387 */       type = MapleInventoryType.EQUIPPED;
     }
/* 1389 */     if (c.getPlayer() == null || c.getPlayer().getMap() == null) {
/* 1390 */       return false;
     }
/* 1392 */     Item source = c.getPlayer().getInventory(type).getItem(src);
/* 1393 */     if (quantity < 0 || source == null || (!npcInduced && ItemConstants.isPet(source.getItemId())) || (quantity == 0 && !ItemConstants.isRechargable(source.getItemId())) || c.getPlayer().inPVP()) {
/* 1394 */       c.announce(MaplePacketCreator.enableActions());
/* 1395 */       return false;
     }



/* 1400 */     if (!npcInduced && source.getItemId() == 4000463) {
/* 1401 */       c.getPlayer().dropMessage(1, "该道具无法丢弃.");
/* 1402 */       c.announce(MaplePacketCreator.enableActions());
/* 1403 */       return false;
     }

/* 1406 */     short flag = source.getFlag();
/* 1407 */     if (quantity > source.getQuantity() && !ItemConstants.isRechargable(source.getItemId())) {
/* 1408 */       c.announce(MaplePacketCreator.enableActions());
/* 1409 */       return false;
     }
/* 1411 */     if (ItemFlag.封印.check(flag) || (quantity != 1 && type == MapleInventoryType.EQUIP)) {
/* 1412 */       c.announce(MaplePacketCreator.enableActions());
/* 1413 */       return false;
     }
/* 1415 */     Point dropPos = new Point(c.getPlayer().getPosition());
/* 1416 */     c.getPlayer().getCheatTracker().checkDrop();
/* 1417 */     if (quantity < source.getQuantity() && !ItemConstants.isRechargable(source.getItemId())) {
/* 1418 */       Item target = source.copy();
/* 1419 */       target.setQuantity(quantity);
/* 1420 */       source.setQuantity((short)(source.getQuantity() - quantity));
/* 1421 */       c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(1, source))));
/* 1422 */       spawnItemDrop(c, target, ii, flag, dropPos);
     } else {
/* 1424 */       c.getPlayer().getInventory(type).removeSlot(src);
/* 1425 */       if (ItemConstants.isHarvesting(source.getItemId())) {
/* 1426 */         c.getPlayer().getStat().handleProfessionTool(c.getPlayer());
       }
/* 1428 */       c.announce(InventoryPacket.modifyInventory(true, Collections.singletonList(new ModifyInventory(3, source))));
/* 1429 */       if (src < 0) {
/* 1430 */         c.getPlayer().equipChanged();
       }
/* 1432 */       spawnItemDrop(c, source, ii, flag, dropPos);
     }
/* 1434 */     return true;
   }

   private static void spawnItemDrop(MapleClient c, Item item, MapleItemInformationProvider ii, short flag, Point dropPos) {
/* 1438 */     log.info("[丢弃物品] " + c.getPlayer().getName() + " 道具:" + item.getItemId() + "-" + ii.getName(item.getItemId()) + " 数量:" + item.getQuantity() + " 地图:" + c.getPlayer().getMapId());
/* 1439 */     if (ItemConstants.isPet(item.getItemId()) || ItemFlag.不可交易.check(flag) || ii.isDropRestricted(item.getItemId()) || ii.isAccountShared(item.getItemId())) {
/* 1440 */       if (ItemFlag.可以交换1次.check(flag)) {
/* 1441 */         flag = (short)(flag - ItemFlag.可以交换1次.getValue());
/* 1442 */         if (ItemFlag.宿命剪刀.check(flag)) {
/* 1443 */           flag = (short)(flag - ItemFlag.宿命剪刀.getValue());
         }
/* 1445 */         item.setFlag(flag);
/* 1446 */         c.getPlayer().getMap().spawnItemDrop((MapleMapObject)c.getPlayer(), c.getPlayer(), item, dropPos, true, true);
       } else {
/* 1448 */         c.getPlayer().getMap().disappearingItemDrop((MapleMapObject)c.getPlayer(), c.getPlayer(), item, dropPos);
       }
     } else {
/* 1451 */       c.getPlayer().getMap().spawnItemDrop((MapleMapObject)c.getPlayer(), c.getPlayer(), item, dropPos, true, true);
     }
   }
 }


/* Location:              C:\PGX\Server.jar!\server\MapleInventoryManipulator.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */